package com.health.db.service.sm.impl;

import com.health.db.service.sm.ISMSSendService;
import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest;

/*
 * 单纯用于发送短信   不去判断短信是否发送成功
 * 
 */
public class SMSSendServiceImpl implements ISMSSendService{
	
	
	private static String serverUrl = "http://gw.api.taobao.com/router/rest";
	private static String appKey = "23312748";
	private static String appSecret =  "d7badcea8b88c4560868f1a4e3c246c9";
	
	
	
	//${docName}医生您好！您有一份健康档案未处理！请您及时处理！
	@Override
	public void notice85605027(String  docName,String docPhone) {
		
		TaobaoClient clients = new DefaultTaobaoClient(serverUrl,appKey ,appSecret);
		AlibabaAliqinFcSmsNumSendRequest AliReq = new AlibabaAliqinFcSmsNumSendRequest();
		AliReq.setSmsType("normal");
		AliReq.setSmsFreeSignName("首儿健康汇");
		AliReq.setSmsParamString("{\"docName\":\" "+docName +"\""+"}");
		AliReq.setRecNum(docPhone);
		AliReq.setSmsTemplateCode("SMS_85605027");
		try {
			clients.execute(AliReq);
		} catch (ApiException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	//${docName}医生您好！您有一份健康档案需要重新编辑并提交！如有问题请及时联系首儿健康小助手。
	@Override
	public void notice85765027(String  docName,String docPhone) {
		
		TaobaoClient clients = new DefaultTaobaoClient(serverUrl,appKey ,appSecret);
		AlibabaAliqinFcSmsNumSendRequest AliReq = new AlibabaAliqinFcSmsNumSendRequest();
		AliReq.setSmsType("normal");
		AliReq.setSmsFreeSignName("首儿健康汇");
		AliReq.setSmsParamString("{\"docName\":\" "+docName +"\""+"}");
		AliReq.setRecNum(docPhone);
		AliReq.setSmsTemplateCode("SMS_85765027");
		try {
			clients.execute(AliReq);
		} catch (ApiException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	//您在首儿健康汇为宝宝建立的健康档案已完成。请及时查看！感谢您使用首儿健康汇！
	@Override
	public void notice85735036(String phone) {
		
		TaobaoClient clients = new DefaultTaobaoClient(serverUrl,appKey ,appSecret);
		AlibabaAliqinFcSmsNumSendRequest AliReq = new AlibabaAliqinFcSmsNumSendRequest();
		AliReq.setSmsType("normal");
		AliReq.setSmsFreeSignName("首儿健康汇");
		//AliReq.setSmsParamString("{\"docName\":\" "+docName +"\""+"}");
		AliReq.setRecNum(phone);
		AliReq.setSmsTemplateCode("SMS_85735036");
		try {
			clients.execute(AliReq);
		} catch (ApiException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	//${docName}医生您好！您提供的健康档案，家长需要您的答疑，请您及时查看并回复！
	@Override
	public void notice85785039(String  docName,String docPhone) {
		
		TaobaoClient clients = new DefaultTaobaoClient(serverUrl,appKey ,appSecret);
		AlibabaAliqinFcSmsNumSendRequest AliReq = new AlibabaAliqinFcSmsNumSendRequest();
		AliReq.setSmsType("normal");
		AliReq.setSmsFreeSignName("首儿健康汇");
		AliReq.setSmsParamString("{\"docName\":\" "+docName +"\""+"}");
		AliReq.setRecNum(docPhone);
		AliReq.setSmsTemplateCode("SMS_85785039");
		try {
			clients.execute(AliReq);
		} catch (ApiException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	
	
	//您好！平台有用户反馈,反馈内容为${feedDesc},用户电话为${phone}。
	@Override
	public void notice85730029(String phone,String feedDesc,String feedPhone) {
		
		TaobaoClient clients = new DefaultTaobaoClient(serverUrl,appKey ,appSecret);
		AlibabaAliqinFcSmsNumSendRequest AliReq = new AlibabaAliqinFcSmsNumSendRequest();
		AliReq.setSmsType("normal");
		AliReq.setSmsFreeSignName("首儿健康汇");
		AliReq.setSmsParamString("{\"feedDesc\":\" "+feedDesc+"\",\"phone\":\""+feedPhone +"\""+"}");
		AliReq.setRecNum(phone);
		AliReq.setSmsTemplateCode("SMS_86055042");
		try {
			clients.execute(AliReq);
		} catch (ApiException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	
}
